feat(test): protocol dispatch test against asobi fixture corpus#7
Merged
Conversation
Feeds the 32 canonical server-emitted message envelopes from the asobi protocol fixture corpus through AsobiWebSocket's message handler and asserts the matching listener fires. Catches doc-vs-server drift bugs (silent failures on unknown wire types) before they reach users. WsEventType updated to cover all 32 wire types. Adds: match.matched, match.finished, match.matchmaker_expired, match.matchmaker_failed, match.vote_start, match.vote_tally, match.vote_result, match.vote_vetoed, world.phase_changed, world.finished. Removes stale match.input (client-to-server only, server never emits). Test framework: vitest. Wired to a new Test workflow on Node 20. Lint workflow extended to type-check the test tree via tsconfig.test.json so WsEventType regressions fail at compile time. Fixtures live under test/fixtures and are excluded from the published package (files field already restricted to dist + src).
Taure
added a commit
that referenced
this pull request
May 2, 2026
Rewrites the README so it reflects what asobi-js actually is — a thin transport client for the asobi protocol — and drops the broad feature-table claims (worlds, terrain, voting, economy, leaderboards, etc.) that overstated coverage. Changes: - Add Scope and Status sections; mark typed REST helpers as deprecated for v1.0 - Replace REST-heavy quickstart with a WebSocket-only example using `AsobiWebSocket` - Add API reference block for `AsobiWebSocket` - Move engine/framework integrations (Phaser/Three/Pixi) to opt-in `examples/` rather than bundled exports - Remove the Features matrix that promised full coverage of unstable subsystems Rebase note: this PR was rebased onto main after #4/#5/#7/#8 landed. The README conflict was resolved by keeping the PR's narrowed-scope structure (Scope/Status/API/adapters sections, no Features table) while preserving main's factual updates that don't conflict with the narrowing: the Node 22+ header, the @widgrensit/asobi package name, the "Run a backend first" section pointing at sdk_demo_backend on :8084, the Browser usage section, and the canonical link to the WebSocket protocol guide. The PR's deletion of the Features matrix and REST-flavoured quickstart was preserved — that deletion is the whole point of the PR. No code change. Code refactor follows in a separate PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixtures live under `test/fixtures` and are not bundled with the published package (the `files` field is restricted to `dist` + `src`).
Test plan